<!doctype html>
<html>
<head>
<meta charset="utf-8">
<title>Add Group</title>
<link rel="stylesheet" type="text/css" href="../style.css">
</head>
<body>
<h3>Enter Group Details Below...</h3>
<form action="#" method="post">
Name:<br/>
<input type="text" name="gname" size="30" placeholder="Enter Group Name" class="txt"><br/>
Description:<br/>
<textarea cols="30" rows="5" placeholder="Enter Group's Description here" name="description"></textarea><br/>
<input type="submit" name="submit" value="Add Group" class="sbtns">&emsp;&emsp;&emsp;
<input type="reset" name="reset" value="Cancel" class="sbtns">
</form><br/>
<?php
$myconn=mysql_connect("localhost","root","") or die("Could not Establish Connection".mysql_error());
$mydb=mysql_select_db("contacts_ms",$myconn) or die("No DB Selected".mysql_error());
if(isset($_POST['submit'])){
	$status="EM";
	$grpname=$_POST['gname'];
	$description=$_POST['description'];
$myqry=mysql_query("INSERT INTO info_group(status,name,description) VALUES('$status','$grpname','$description')");
if(!$myqry){
	$response="Could Not Post to Database";
}
else
$response="Successfully added group";
echo $response;
}
?>
</body>
</html>